home *** CD-ROM | disk | FTP | other *** search
/ 1000 Apple LAN Literacy / 1000 Apple LAN Literacy.iso / Apple LAN Literacy / Literacy Segments Part 3 / Literacy Segments Part 3 / stack_-1.xml < prev    next >
Extensible Markup Language  |  1989-08-22  |  20KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>231</cardCount>
  7.     <cardID>26202</cardID>
  8.     <listID>65426</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-----------------------------------------------------------------------                    ‚ÄúNetwork & Communications‚Äù--                   ‚ÄúApple LAN Literacy Course‚Äù--                  ¬© 1989 Apple Computer, Inc. &--                     ¬© 1989 Courseware, Inc. &--                        ¬© 1989 HyperPro, Inc.----                          Version 1.0f5------------------------------------------------------------------------ Stack: Literacy Segments Part 3---- HANDLERS: openstack,findSetUp,openBackground,Lesson,InstantReference,--           goItem,beenHereFlag,SSpopUp,doSS,checkBookmark,--           askBookmark,Help,MainMenu,SSQuit,doMenu,Map,Scrapbook,--           Index,Glossary,Note,BookMark,SnapShot,saveMyPlace,--           saveIdentifier,goBackWhere,popBack,popWhere,Search,--           returnKey,enterKey,searchForIt,SwitchStack-- FUNCTIONS: whereAmI,validField-- RESOURCES:-- ICON: Student Services,GrayPrev,Help,Prev Card,Lg #2,Lg #3,--       Lg #1 Outline,Lg #2 Outline,Lg #3 Outline,Lg #1,#1,#2,--       #1 Outline,#2 Outline,GrayNext,Next Card,Grey Up Arrow,--       Up Arrow,Modem,Telephone,Computer w/backdrop,Satelite Dish,--       Telephone Lines,Computer Cable,String,Tin Cans,Cable,--       Computer,Printer,To Menus,Lg #4,Lg #4 Outline,#3,#4,#5,--       #3 Outline,#4 Outline,#5 Outline-- XFCN: kPopUp-- vers:-- DITL: Answer-- FONT: Garamond---------------------------------------------------------------------------- By Apple Computer, Inc., Courseware, Inc. & HyperPro, Inc.------------------------------------------------------------------------on openstackglobal setupOkget the versionif it < 1.2 thenanswer "This stack requires HyperCard v1.2.2 or later."go backexit to HyperCardend ifif setupOk is empty then findSetup -- otherwise it's true, continueglobal gSystemFile,useSS,mapTrackerif useSS thenopen file gSystemFileread from file gSystemFile for 16384put line 1 to 3 of it into theContentsclose file gSystemFileput mapTracker into line 4 of theContentsopen file gSystemfilewrite theContents to file gSystemFileclose file gSystemFileend ifhide menubarhide msgend openStackon findSetUpset lockmessages to trueset cursor to watchgo stack "Literacy Course"if the result is "cancel" thenanswer "Unable to continue.  ‚ÄúLiteracy Course‚Äù not found."domenu Quit Hypercardexit to Hypercard -- exit calling handlerselse -- found course setup cardset lockmessages to falsesend openstack to this stack -- the setup stackexit to HyperCardend ifend findSetUpon openBackgroundglobal mapTrackerget char 1 to 5 of the short name of this bgif it is not in mapTracker thenput it & "," after mapTrackerend ifpass openBackgroundend openBackgroundon Lessonlock screenset cursor to watchput char 1 to 5 of the short name of this bg into segNumgo "Literacy Main Menu"get script of bg btn "Card Key"put offset(segNum,it) into tempput line (number of lines in char 1 to temp of it) of it into theCarddelete char 1 to 6 of theCardgo cd theCardunlock screen with visual zoom openend Lessonon InstantReference segNumlock screenget the clicklocput item 1 of it into xput item 2 of it into yput left of the target + width of the target - x into x1put y - top of the target into y1put x - item 1 of the loc of the target into x2put y - item 2 of the loc of the target into y2subtract left of the target from xsubtract top of the target from yif SQRT(x2*x2 + y2*y2) > 27 then exit InstantReferenceif x1 < y1thenif x < ythengo cd 1 of bg (segNum && "Practice")elsego cd 1 of bg (segNum && "Example")end ifelseif x < ythengo cd 1 of bg (segNum && "Information")elsego cd 1 of bg (segNum && "Content")end ifend ifunlock screenend InstantReferenceon goItemput last char of the short name of the target into tempput "#" & temp into btnNumb -- btn names are #1, #2, etcput "422" & temp into iconNumb -- or "424" for large numbersset the icon of btn btnNumb to iconNumbgo cd temp + the number of this cdend goItemon beenHereFlag itemNum,lineNumglobal btnStatus-- if line (other than first) of var is empty, then placement of data-- in particular "item" doesn't work due to HyperCard 1.2.2 bug. So if-- line empty, string "dummy" goes in, data placed, & string pulled.if line lineNum of btnStatus is emptythen put "dummy" into line lineNum of btnStatusput "true" into item itemNum of line lineNum of btnStatusif item 1 of line lineNum of btnStatus = "dummy"then put empty into item 1 of line lineNum of btnStatusend beenHereFlag-----------------Here are the StudentServices scripts -------------------- version 1.0f4on SSpopUpglobal useSS,courseset hilite of the target to trueget kPopUp("init",999) -- creates menu in memory-- "(" is meta character for disable item.if useSS thenget the short name of this stackif (it contains "scrapbooK") or (it contains "snapshot") thenput "MainMenu;" & "(" & "BookMark‚Ķ;" & "(" & "Note‚Ķ;" &¬¨"(" & "SnapShot‚Ķ;Index;Scrapbook;" &¬¨"Search‚Ķ;Map;Glossary;Quit‚Ķ" into choiceelseput "MainMenu;BookMark‚Ķ;Note‚Ķ;SnapShot‚Ķ;Index;Scrapbook;" &¬¨"Search‚Ķ;Map;Glossary;Quit‚Ķ" into choiceend ifelseput "MainMenu;" & "(" & "BookMark‚Ķ;" & "(" & "Note‚Ķ;" &¬¨"(" & "SnapShot‚Ķ;" & "(" & "Index;" & "(" & "Scrapbook;" &¬¨"Search‚Ķ;Map;Glossary;Quit‚Ķ" into choiceend ifif not course then -- needed for scrapbook & snaps scripts onlyput "(" & "MainMenu;" & "(" & "BookMark‚Ķ;" & "(" & "Note‚Ķ;" &¬¨"(" & "SnapShot‚Ķ;Index;Scrapbook;" &¬¨"Search‚Ķ;" & "(" & "Map;Glossary;Quit‚Ķ" into choiceend ifget kPopUp("append",999,choice) -- 999 is reference #-- popup menu doesn't show yetget kPopUp("pop",999,1,bottom of the target,left of the target + 1)-- pop returns ID number of menu, number of item selectedset cursor to watchput kPopUp("GetItem",item 1 of it,item 2 of it) into command-- returns text of itemget kPopUp("toss",999) -- remove menu from memoryset hilite of the target to falseif last char of command is "‚Ķ" then delete last char of command-- Don't use "quit" -- potential conflicts with home scriptsif command = "quit" then put SSQuit into commandcheckBookmark commandif command ‚↠"no such menu" thendo commandend ifend SSpopUpon doSSglobal scrapFileif the short name of this stack contains "scrapbook" thensend doSS to bg 1 -- script is there, shortcut heirarchyexit to HyperCardend iflock screenpush cardset lockmessages to trueset cursor to watchgo stack scrapFileif the result is "cancel" then popBack-- call with Literacy, ANP, or Administration from courses *!*-- call with "scrapbook" from snapshots or scrapbook *!*put SSDialog("Literacy") into command --*!*pop cardunlock screenset lockmessages to falsecheckBookmark command-- Don't use "quit" -- potential conflicts with home scriptsif command = "quit" then put SSQuit into commandif command = "Cancel" then exit doSSelse do commandend doSSon checkBookmark commandglobal useSSif whereAmI() then exit checkBookMarkif not useSS then exit checkBookMarkif command = "MainMenu" or command = "Index"¬¨or command = "Scrapbook" or command = "Map"¬¨or command = "Glossary" then askBookmark commandend checkBookmarkon askBookmark commandglobal bookmarkPrefif bookmarkPref thenanswer "Create Bookmark before going to" && command &¬¨"?" with "Cancel" or "Just go" or "Bookmark"elseanswer "Create Bookmark before going to" && command &¬¨"?" with "Cancel" or "Bookmark" or "Just go"end ifif it is "Cancel" then exit to HyperCardif it is "just go" then put false into bookmarkPrefif it is "Bookmark" thenput true into bookmarkPrefbookmarkend ifend askBookmarkon Helpglobal courseif not course thenanswer "Help is not available without the course."exit helpend iflock screensaveMyPlaceset cursor to watchgo stack "N&C Help"if the result is "cancel" then goBackWhere -- exitshide cd pictunlock screen with visual dissolvewait 30show cd pictend Helpon MainMenulock screenset LockMessages to trueset cursor to watchgo stack "Literacy Main Menu" -- or Literacy or Administration *!*if the result is "cancel" then exit to Hypercard-- Literacy doesn't do this.if the short name of this stack is "ANP Main Menu" thenrepeat with k = the number of cds down to 1go cd kopencardend repeatend ifset lockMessages to falseunlock screen with visual dissolveend MainMenuon SSQuitglobal gSystemFile,useSS,mapTracker,menuHilites,courseglobal bookmarkPref,wherewecamefrom,OKtoQuit,scrapFileput whereAmI() into fromScrapbook --*!* use false in peripheralsif not useSS then put true into fromScrapbook -- no bookmarksif fromScrapbook thenanswer "Do you want to quit the course?" with¬¨"Cancel" or "Yes, quit"if it is "Cancel" thenexit to Hypercardend ifelseif bookmarkPref thenanswer "Create Bookmark & quit this course?"¬¨with "Cancel" or "Just quit" or "OK"elseanswer "Create Bookmark & quit this course?"¬¨with "Cancel" or "OK" or "Just quit"end ifif it is "Cancel" then exit to hypercardif it is "OK" then bookmarkend ifif not fromscrapbook then saveMyPlaceif useSS and course thenopen file gSystemFileread from file gSystemFile for 16384put line 1 to 2 of it into theContentsclose file gSystemFileput wherewecamefrom into line 3 of theContentsput mapTracker into line 4 of theContentsopen file gSystemfilewrite theContents to file gSystemFileclose file gSystemFilelock screengo stack scrapFileput theContents into cd fld "hidden name"end ifput true into OKtoQuitdomenu "Quit Hypercard"exit to hypercardend SSquiton doMenu varglobal OKtoQuitif OKtoQuit is empty then put false into OKtoQuitif var = "Find..." then search --*!* not in peripheralselse if var = "Quit HyperCard" and OKtoQuit is false then ssQuitelse if var = "Quit HyperCard" and OKtoQuit then pass doMenuelse pass doMenuend doMenuon Mapglobal gSystemFileput whereAmI() into fromScrapbookif gSystemFile contains "ANP" then put true into ANPCourseelse put false into ANPCoursesaveMyPlacelock screenif ANPCourse thenput char 1 to 5 of short name of this stack into tempelseput char 1 to 5 of the short name of this bg into tempend ifset cursor to watchgo stack "Literacy Map" -- or Literacy or Administration *!*if the result is "cancel" then goBackWhere -- exitsif fromScrapbook thenunlock screen with visual dissolveexit mapend ifif not ANPCourse then -- Literacy mapset icon of bg btn temp to 1201put temp into numput "0" into last char of temp   -- calc number for current lessonput script of bg btn "lesson key" into theList-- "Lesson Key" holds # of first cd where lesson appearsput offset(temp,theList) into theLineput word 2 of line (number of lines in char 1 to theLine of¬¨theList) of theList into theCardgo cd theCardshow cd fld "instruction"put num into hiliterelse -- ANP mapclick at the loc of bg btn tempput "Go" && temp into hiliterend ifunlock screen with visual dissolverepeat 3set the hilite of btn hiliter to truewait 20set the hilite of btn hiliter to falsewait 20end repeatend Mapon Scrapbookglobal scrapFile,whereWeCameFromput whereAmI() into fromScrapbooksaveMyPlaceset cursor to watchlock screengo cd 1 of stack scrapFileif the result is "cancel" then goBackWhere -- exitsif fromScrapbook then delete last item of wherewecameFromsend openbackground to this cdunlock screen with visual dissolveend Scrapbookon Indexglobal scrapFile,whereWeCameFromput whereAmI() into fromScrapbooksaveMyPlacelock screenset cursor to watchgo cd "Index" of stack scrapFileif the result is "cancel" then goBackWhere -- exitsif fromScrapbook then delete last item of whereWeCameFromsend openbackground to this cdunlock screen with visual dissolveend Indexon Glossaryglobal scrapFile,whereWeCameFromput whereAmI() into fromScrapbooksaveMyPlacelock screenset cursor to watchgo cd "Glossary" of stack scrapFileif the result is "cancel" then goBackWhere -- exitsif fromScrapbook then delete last item of whereWeCameFromsend openbackground to this cdunlock screen with visual dissolveend Glossary-- note isn't available from Student Scrapbookon Noteglobal scrapFilesaveIdentifierput false into madeNotepush cdset cursor to watchlock screenset lockMessages to truego cd "index" of stack scrapFileif the result is "cancel" then popBack -- exitsput makeNote() into myResultif myResult is "successful" then put true into madeNotepop cdset lockmessages to falseif madeNote then unlock screen with iris open to blackelse unlock screenif myResult is "SS" then doSSend Note-- Bookmark isn't available from Student Scrapbook.on BookMarkglobal scrapFilesaveIdentifiersaveMyPlaceput false into madeBookMarkpush cdset cursor to watchlock screenset lockMessages to truego cd "index" of stack scrapFileif the result is "cancel" then popWhere -- exitsput makeBookMark() into myResultif myResult is "successful" then put true into madeBookMarkpop cdset lockmessages to falseif madeBookMark then unlock screen with iris open to blackelse unlock screenif myResult is "SS" then doSSend bookMark-- Snapshot isn't available from the Student Scrapbook.on SnapShotglobal scrapFilesaveMyPlacesaveIdentifierput false into madeSnapShotpush cdset cursor to watchlock screenunlock screen -- for refresh, since we're taking a picture of itlock screenset lockMessages to truego cd "index" of stack scrapFileif the result is "cancel" then popWhere -- exitsput makeSnapShot() into myResultif myResult is "successful" then put true into madeSnapShotpop cdset lockmessages to falseif madeSnapShot then unlock screen with iris open to blackelse unlock screenif myResult is "SS" then doSSend SnapShotfunction whereAmIget the short name of this stackif it contains "scrapbook" or it contains "snapshot" thenreturn trueelsereturn falseend ifend whereAmIon saveMyPlaceglobal whereWeCameFromput the id of this cd && "of stack" && quote &¬¨the short name of this stack & quote into thisPlaceif not (last item of whereWeCameFrom = thisPlace) thenput thisPlace into item (number of items in whereWeCameFrom) + 1¬¨of whereWeCameFromend ifend saveMyPlaceon saveIdentifierglobal identifierput the short name of this cd into identifierend saveIdentifieron goBackWhereglobal wherewecamefromset cursor to watchgo last item of whereWeCameFromdelete last item of whereWeCameFromset lockMessages to falseexit to Hypercardend goBackWhereon popBackpop cardset lockMessages to falseexit to hypercardend popBackon popWhereglobal whereWeCameFrompop carddelete last item of whereWeCameFromset lockMessages to falseexit to Hypercardend popWhere-----------------  Search script handlers‚Ķ---- Search script hunts for string through multiple stacks.-- Each stack must have the handlers in it for this to work.-- Modified from TIE search script which was written by Garth-- Catterall and Ken Laws.  Leslie Grimmon Searchglobal gfindWhat,gfindHow,gFindWhere,gWhichStack,gFirstStack,¬¨gFindFlag,gFirstCard,gFindCount,gFirstChunk,gStartCard,gLastCard,¬¨gNumStacks,gNextStackglobal scrapFilepush cardlock screenset lockmessages to trueset cursor to watchput whereAmI() into fromScrapbookgo stack scrapFileif the result is "cancel" thenpop card into trash -- clean up stackexit to Hypercardend if-- get gfindWhat,gfindWhere,gfindHow & gNextStackput searchDialog(fromScrapbook) into myResultif myResult is "SS" thenpop cardset lockmessages to falseunlock screendoSSexit searchend ifif myResult is "Cancel" thenpop cardset lockmessages to falseunlock screenexit searchend ifif myResult is "Bookmark" thenpop cardset lockmessages to falsebookmarkpush card-- then continue searchend ifput empty into gFirstChunk -- reset variablesput empty into gFirstCardput the visible of the msg into visiMsgput empty into msg -- so return/enter will work.  See below.set the visible of the msg to visimsgput 0 into gFindCountput 1 into gWhichStackput true into gFindFlag -- search is validpop cardpush card -- so we can come back laterunlock screen -- screen refreshlock screenput the number of this cd into gStartCardif not fromScrapbook then saveMyPlace -- to get back from glossaryput the short name of this stack into gFirstStack-- initialize index for searching through multiple stacksput the number of items in gNextStack into gNumstacksput false into inListrepeat with i = 1 to gNumStacksif (item i of gNextStack contains gFirstStack) thenput i into gWhichStackput true into inListexit repeatend ifend repeatif not inList thenput 1 into gWhichStackput item 1 of gNextStack into gFirstStackset lockmessages to truego stack gFirstStackput 1 into gStartCardend ifsearchForItend Searchon returnKeyglobal gFindWhat,gFindFlag,gNextStackif (gFindWhat ‚↠empty) and (gFindFlag = true) and¬¨(the msg is empty) thensearchForItelse-- ** put empty into gNextStack -- clear possibly big variablepass returnKeyend ifend returnKeyon enterKeyglobal gFindWhat,gFindFlag,gNextStackif (gFindWhat ‚↠empty) and (gFindFlag = true) and¬¨(the msg is empty) thensearchForItelse--** put empty into gNextStack -- clear possibly big variablepass enterKeyend ifend enterKeyon searchForItglobal gFindWhat,gFindHow,gFindWhere,gWhichStack,gNumStacks,¬¨gStartCard,gFindFlag,gFirstCard,gFindCount,gFirstChunk,gLastCardset cursor to busy--** lock screenput the number of this cd into gLastCardset lockmessages to truerepeatset cursor to busyif gFindHow = "Exact String" then find string gFindWhatelse if gFindHow = "First Characters" then find gFindWhatelse if gFindHow = "Whole Word(s)" then find whole gFindWhatput the FoundChunk into holder -- eg char 1 to 6 of cd fld 4put the short name of the FoundField into checkerif holder is empty then  -- not found anywhere in the stack-- if we were only looking in one stack, then leaveif gNumstacks = 1 thenpop card -- go back where we startedanswer "Couldn‚Äôt find ‚Äú" & gFindWhat & ".‚Äù"put false into gFindFlagset lockmessages to falseexit searchForItelseSwitchStacknext repeatend ifend ifif gFirstChunk is empty then  -- set our referencesput holder into gFirstChunk -- eg char 1 to 6 of cd fld 4put the number of this cd into gFirstCardelse-- is this where we started the search?if (holder = gFirstChunk) and ¬¨(the number of this card = gFirstCard) thenif gNumStacks > 1 thenSwitchStacknext repeatend ifif gFindCount = 0 thenpop cardanswer "‚Äú" & gFindWhat & "‚Äù not found."put false into gFindFlagput empty into gNextStack -- free the memoryset lockmessages to falseexit searchForItelseanswer "No more occurrences of ‚Äú" & gFindWhat &¬¨"‚Äù were found."if gStartCard ‚↠(the number of this cd) or¬¨gLastCard ‚↠(the number of this cd) thenanswer "Stay here or go back to beginning card?"¬¨with "Stay" or "Go back"if it is "go back" then pop cardelsepop cd into throwaway -- clean up our poo-pooif the short name of this bg is "glossary" or¬¨the short name of this bg is "snapshots" then-- update return arrow and tabssend openbackground to this backgroundend ifend ifend ifend ifput false into gFindFlagset lockmessages to falseexit searchForItend ifend if-- We do the check for valid fields after setting firstCard-- so that we know where the first found item was, even though-- it might not be visible.if the short name of this cd is "glossary" thenif gFindWhere contains "glossary" thensend openbackground to bg "glossary" -- to mask tabs if neededadd 1 to gFindCountsend glossFind to bg "glossary"e